/**
 * $Id$ Copyright 2009-2012 Oak Pacific Interactive. All rights reserved.
 */
package com.shuqi.model.parse.parser;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import com.shuqi.model.parse.HandlerBase;

/**
 * 
 * 
 * @author <a href="mailto:">yaozhen</a>
 * @version 2014-2-11下午7:45:47
 */
public class FindPasswordByEmailParser extends HandlerBase {

    private FindPasswordByEmailParserInfo info;

    @Override
    public void startDocument() throws SAXException {
        super.startDocument();
        info = new FindPasswordByEmailParserInfo();
    }

    @Override
    public void startElement(String uri, String localName, String name, Attributes attrs)
            throws SAXException {
        if (localName.equals("Item")) {
            if (attrs != null) {
                try {
                    info.code = Integer.valueOf(isNull(attrs, "code"));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                info.message = isNull(attrs, "message");
            }
        }
    }

    @Override
    public FindPasswordByEmailParserInfo getParsedData() {
        return info;
    }

    public static class FindPasswordByEmailParserInfo {

        public int code;

        public String message;
    }
}
